home *** CD-ROM | disk | FTP | other *** search
/ Programming a Multiplayer FPS in DirectX / Programming a Multiplayer FPS in DirectX (Companion CD).iso / DirectX / dxsdk_oct2004.exe / dxsdk.exe / Samples / C++ / Common / dxstdafx.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-09-30  |  2.5 KB  |  89 lines

  1. //--------------------------------------------------------------------------------------
  2. // File: DxStdAfx.h
  3. //
  4. // Desc: Header file that is the standard includes for the DirectX SDK samples
  5. //
  6. // Copyright (c) Microsoft Corporation. All rights reserved.
  7. //--------------------------------------------------------------------------------------
  8. #pragma once
  9. #ifndef DXSDK_STDAFX_H
  10. #define DXSDK_STDAFX_H
  11.  
  12. #define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
  13. #define STRICT
  14.  
  15. // Works with Windows 2000 and later and Windows 98 or later
  16. #undef _WIN32_IE
  17. #undef WINVER
  18. #undef _WIN32_WINDOWS
  19. #undef _WIN32_WINNT
  20. #define WINVER         0x0500 
  21. #define _WIN32_WINDOWS 0x0410 
  22. #define _WIN32_WINNT   0x0500 
  23.  
  24. #include <windows.h>
  25. #include <assert.h>
  26. #include <wchar.h>
  27. #include <mmsystem.h>
  28. #include <commctrl.h> // for InitCommonControls() 
  29. #include <shellapi.h> // for ExtractIcon()
  30. #include <new.h>      // for placement new
  31. #include <math.h>      
  32. #include <limits.h>      
  33. #include <stdio.h>
  34.  
  35.  
  36. // Enable extra D3D debugging in debug builds if using the debug DirectX runtime.  
  37. // This makes D3D objects work well in the debugger watch window, but slows down 
  38. // performance slightly.
  39. #if defined(DEBUG) | defined(_DEBUG)
  40. #define D3D_DEBUG_INFO
  41. #endif
  42.  
  43. // Direct3D includes
  44. #include <d3d9.h>
  45. #include <d3dx9.h>
  46. #include <dxerr9.h>
  47.  
  48. // DirectSound includes
  49. #include <mmsystem.h>
  50. #include <mmreg.h>
  51. #include <dsound.h>
  52.  
  53. #include "DXUT.h"
  54. #include "DXUTmisc.h"
  55. #include "DXUTenum.h"
  56. #include "DXUTeffectmap.h"
  57. #include "DXUTmesh.h"
  58. #include "DXUTgui.h"
  59. #include "DXUTsettingsDlg.h"
  60. #include "DXUTSound.h"
  61.  
  62. #if defined(DEBUG) | defined(_DEBUG)
  63.     #ifndef V
  64.         #define V(x)           { hr = x; if( FAILED(hr) ) { DXUTTrace( __FILE__, (DWORD)__LINE__, hr, L#x, true ); } }
  65.     #endif
  66.     #ifndef V_RETURN
  67.         #define V_RETURN(x)    { hr = x; if( FAILED(hr) ) { return DXUTTrace( __FILE__, (DWORD)__LINE__, hr, L#x, true ); } }
  68.     #endif
  69. #else
  70.     #ifndef V
  71.         #define V(x)           { hr = x; }
  72.     #endif
  73.     #ifndef V_RETURN
  74.         #define V_RETURN(x)    { hr = x; if( FAILED(hr) ) { return hr; } }
  75.     #endif
  76. #endif
  77.  
  78. #ifndef SAFE_DELETE
  79.     #define SAFE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
  80. #endif    
  81. #ifndef SAFE_DELETE_ARRAY
  82.     #define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
  83. #endif    
  84. #ifndef SAFE_RELEASE
  85.     #define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=NULL; } }
  86. #endif
  87.  
  88. #endif // !defined(DXSDK_STDAFX_H)
  89.